package com.design.yjx.command.remote;

import com.design.yjx.command.common.Command;
import com.design.yjx.command.common.Fan;
import com.design.yjx.command.common.FanOffCommand;
import com.design.yjx.command.common.FanOnCommand;
import com.design.yjx.command.common.Light;
import com.design.yjx.command.common.LightOffCommand;
import com.design.yjx.command.common.LightOnCommand;
import com.design.yjx.command.common.MacroCommand;

/**
 * @author yuanjianxin
 * @date 2017/8/21 14:24
 */
public class Main3 {
    public static void main(String[] args) {
        RemoteControl control = new RemoteControl();

        Light light  = new Light();
        Command onLight = new LightOnCommand(light);
        Command offLight = new LightOffCommand(light);

        Fan fan = new Fan();
        Command onFan = new FanOnCommand(fan);
        Command offFan = new FanOffCommand(fan);

        Command[] onCommands = {onLight,onFan};
        Command[] offCommands = {offLight,offFan};

        Command macroOnCommand = new MacroCommand(onCommands);
        Command macroOffCommand = new MacroCommand(offCommands);

        control.setCommand(1,macroOnCommand,macroOffCommand);

        control.onButtonWasPushed(1);
        control.undoButtonWasPushed();
//        control.offButtonWasPushed(1);

    }
}
